package ca.quicko.dao.jpa;

import java.util.List;

import javax.persistence.Query;

import org.appfuse.dao.jpa.GenericDaoJpa;

import ca.quicko.dao.SolutionDao;
import ca.quicko.model.Solution;

/**
 * @author <a href="mailto:eric.s.landry@gmail.com">Eric S. Landry</a>
 */
public class SolutionDaoJpa extends GenericDaoJpa<Solution, Long> implements
		SolutionDao {
	public SolutionDaoJpa() {
		super(Solution.class);
	}

	@SuppressWarnings("unchecked")
	public List<Solution> findByTitle(String title) {
		Query q = super.entityManager
				.createQuery("select t from Title t where t.title=?");
		q.setParameter(1, title);
		return q.getResultList();
	}
}